#
# Install T-One images tar file to $PROTO/data/tone
#

PROTO		= ~/proto
PROTO_BIN	= $(PROTO)/bin
PROTO_ETC	= $(PROTO)/etc
PROTO_DATA	= $(PROTO)/data
PROTO_DATA_TONE	= $(PROTO_DATA)/tone
USER		= $(shell id -un)
GROUP		= $(shell id -gn)

TONE_IMAGES_TAR_GZ_FILE	= tone-images-v1030_x86_with_testlib.tar.gz
TONE_IMAGES_TAR_FILE	= tone-images-v1030_x86.tar

all: $(TONE_IMAGES_TAR_FILE)

.PHONY: all clean clobber cl install ins uninstall uns

$(TONE_IMAGES_TAR_FILE): $(TONE_IMAGES_TAR_GZ_FILE)
	tar zxf $<

install:
	install -m 0755 -o $(USER) -g $(GROUP) -d $(PROTO_DATA_TONE)
	install -m 0555 -o $(USER) -g $(GROUP) \
		$(TONE_IMAGES_TAR_FILE) \
		$(PROTO_DATA_TONE)/$(TONE_IMAGES_TAR_FILE)
ins: install

uninstall:
	rm -f $(PROTO_DATA_TONE)/$(TONE_IMAGES_TAR_FILE)
uns: uninstall

clean:

clobber: clean
	rm -f $(TONE_IMAGES_TAR_FILE)
cl: clobber
